<template>
	<view>
		<f-navbar title="我的发布" fontColor="#ffffff" bgColor="#ffa200" :scrollTop="scrollTop" navbarType='0'></f-navbar>
		<view class="father">
			<view :class="item.id===showTable?'sunactive':''" v-for="item in fileList" @click="toggleTable(item.id)">
				{{item.name}}
			</view>
		</view>
		<view>
			<view v-for="item in fileList">
				<view v-show="item.id===showTable">
					<view v-for="items in item.list">
						<view style="display: flex;align-items: center;justify-content: space-between;">
							<view style="display: flex;align-items: center;">
								<image :src="items.imgeurl" style="width: 70px;height: 70px;border-radius: 50%;padding: 10px 20px;"></image>
								<view>
									<view>{{items.name}}</view>
									<view style="color: red;">￥{{items.price}}元</view>
								</view>
							</view>
							<view style="margin-right: 15px;">
								X{{items.count}}
							</view>
						</view>
						<view style="margin-left: 20px;">
							商品详情：{{items.details}}
						</view>

					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				fileList: [{
						name: "已发布",
						id: '23001',
						list: [{
							imgeurl: '../../static/other/111.jpg',
							name: '蜘蛛侠',
							price: 1499,
							count: 1,
							details: '来自英雄无归里的蜘蛛man'
						},
						{
							imgeurl: '../../static/other/111.jpg',
							name: '蜘蛛侠',
							price: 1499,
							count: 1,
							details: '来自英雄无归里的蜘蛛man'
						}]
					},
					{
						name: "未发布",
						id: '23002'
					},
					{
						name: "已删除",
						id: '23003'
					},
				],

				showTable: "23001", // 默认显示表格

			}
		},
		methods: {
			toggleTable(ids) {
				console.log(ids);
				this.showTable = ids
			},

		}
	}
</script>

<style lang="scss">
	.father {
		display: flex;
		justify-content: space-around;
		align-items: center;

	}

	.father>view {
		padding: 10px;
		width: 100%;
		border: 1px solid $uni-color-warning;
		text-align: center;
	}

	.sunactive {
		background-color: red;
	}
</style>